package controllers

import (
	"html/template"
	"log"
	"net/http"
)

type Message struct {
	Mess string
	Name string
}

func HtmlLogin(w http.ResponseWriter, r *http.Request) {
	tmpl, _ := template.ParseFiles("views/login.html")
	tmpl.Execute(w, "")
}
func Login(w http.ResponseWriter, r *http.Request) {
	log.Printf("name = %s", r.FormValue("name"))
	log.Printf("pwd = %s", r.FormValue("pasw"))
	name := r.FormValue("name")
	tmpl, _ := template.ParseFiles("views/succes.html")
	msg := Message{"登录成功,尊敬的", name}
	tmpl.Execute(w, msg)
}
